import { createRouter, createWebHistory } from 'vue-router';

//一级路由
import LoginVue from "@/views/Login.vue"
import HomeVue from "@/views/Home.vue"
//二级路由
import ProfileVue from "@/views/user/Profile.vue";
import ChangeAvatarVue from "@/views/user/ChangeAvatar.vue";
import ResetPasswordVue from "@/views/user/ResetPassword.vue";
import LoveWallVue from '@/components/LoveWall.vue';
import FleaMarketVue from '@/components/FleaMarket.vue';
import FindPartnerVue from '@/components/FindPartner.vue';
import RecruitVue from '@/components/Recruit.vue';
import MakePostVue from '@/views/post/MakePost.vue';
import AuditVue from '@/views/post/Audit.vue';
import PostManageVue from '@/views/post/postManage.vue';

const routes = [
    {path:'/login', component: LoginVue},
    {path:'/', component:HomeVue,
    children:[
        {path:'/LoveWall', component: LoveWallVue},
        {path:'/FleaMarket', component: FleaMarketVue},
        {path:'/FindPartner', component: FindPartnerVue},
        {path:'/Recruit', component: RecruitVue},
        {path:'/MakePost', component: MakePostVue},
        {path:'/postManage', component: PostManageVue},
        {path: '/Audit', component: AuditVue},
        { path: '/user/profile', component: ProfileVue },
        { path: '/user/changeavatar', component: ChangeAvatarVue },
        { path: '/user/resetpassword', component: ResetPasswordVue },
    ]
    }
]

const router = createRouter({
    history: createWebHistory(),
    routes: routes
})

export default router